import BaseController from '../../core/baseController';

export default class ActivityApplyController extends BaseController {
  constructor(ctx) {
    super(ctx)
    this.service = ctx.service.sms.coupon,
      this.modelPrefix = 'marketing.coupon'
  }

  // 通用列表
  async userCoupon() {
    const query = this.ctx.validateReq('xxm.market.coupon').query;
    
    const result = await this.ctx.model.UserCoupon.findAll({
      where: {
        user_id: query.user_id
      },
      include: [
        { model: this.ctx.model.SmsCoupon }
      ]
    });

    if (result) {
      this.ctx.success({
        data: result,
      });
    }
  }



}
